package com.preknow.lianxi;

public class Rectangle {
    int length;
    int width;

    public int getArea(){
        return this.length*this.width;
    }

    public int getPer(){
        return (this.length+this.width)*2;
    }

    public void showall(){
        System.out.println(this.length);
        System.out.println(this.width);
        System.out.println(this.getArea());
        System.out.println(this.getPer());
    }

    public  Rectangle(int length,int width){
        this.length = length;
        this.width = width;
    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle(1,2);
        rectangle.showall();
    }
}
